#include<iostream>
#include<queue>
using namespace std;
const int N = 1e5 + 10;
int n, m;
int ans;
priority_queue<int>q;
int main()
{
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		q.push(x);
	}
	while (m--) {
		int t = q.top();
		q.pop();
		q.push(t / 2);
	}
	while (q.size()) {
		ans += q.top();
		q.pop();
	}
	cout << ans << endl;
	return 0;
}